﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;//定义控件用
using UnityEngine.SceneManagement;//跳转界面用

public class StartScript : MonoBehaviour
{
    public GameObject startPanel;
    public Slider loadingBar;
    public GameObject startBtn;
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
        LoadingSlider();
        //Debug.Log("111---"+loadingBar.value);
    }

    //点击开始游戏按钮，隐藏开始游戏图标并显示panel，加载进度条
    public void ClickStartBtn()
    {
        startBtn.SetActive(false);
        startPanel.SetActive(true);
    }
    //加载进度条，当进度条满跳转到主界面
    public void LoadingSlider()
    {
        loadingBar.value += 0.01f;
        if (loadingBar.value >= 1)
        {
            SceneManager.LoadScene("MainGame");
        }
    }
}
